<template>
	<view>
		<bookracks :books="books"></bookracks>
	</view>
</template>

<script>
  import bookracks from "../../components/bookracks/bookracks.vue"
	export default {
    components:{
      bookracks
    },
		data() {
			return {
        books:[],
        uid:''
			};
		},
    onLoad() {
      this.uid=uni.getStorageSync('uid')
      this.selectBook()
      console.log(this.uid)
    },
    onPullDownRefresh() {
      this.selectBook()
    },
    onShow() {
      this.selectBook()
    },
    onHide() {

    },
		methods:{
			selectBook(){
			  uni.request({
			  	url:'http://z7jxxt5.nat.ipyingshe.com/select/bookcase',
			  	method:'POST',
			  	data:{
			      uid:this.uid
			  	},
			  	success:(res)=>{
            this.books=res.data.bookcase
            console.log(this.books)
			  	},
			  })

			},
		}
	}
</script>

<style lang="scss">

</style>
